using MicroMsg.Common.Utils;
using MicroMsg.Manager;
using MicroMsg.Resource.@string;
using MicroMsg.Storage;
using MicroMsg.UI.UserContrl;
using MicroMsg.UI.Util;
using Microsoft.Phone.Shell;
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
namespace MicroMsg.UI.Page
{
	public class LbsInputUserInfo : BasePage
	{
		private const string TAG = "LbsInputUserInfo";
		private string mStrTitle = "";
		private string mStrNextPage = "";
		internal Grid LayoutRoot;
		internal panelTitle2Line panelTitle;
		internal StackPanel ContentPanel;
		internal SetAccInfoSexAreaSigCtrl ctrlSetSexAreaSig;
		private bool _contentLoaded;
		public LbsInputUserInfo()
		{
			this.InitializeComponent();
			if (base.get_ApplicationBar() != null && 1 == base.get_ApplicationBar().get_Buttons().get_Count())
			{
				ApplicationBarIconButton applicationBarIconButton = base.get_ApplicationBar().get_Buttons().get_Item(0) as ApplicationBarIconButton;
				applicationBarIconButton.set_Text(strings.COM_Next);
			}
			this.ctrlSetSexAreaSig.showStars();
		}
		protected override void OnPageIn(object[] object_0)
		{
			Log.smethod_5("LbsInputUserInfo", "OnPageIn");
			if (object_0 != null && 2 == object_0.Length && object_0[0].GetType() == typeof(string))
			{
				if (object_0[1].GetType() == typeof(string))
				{
					this.mStrTitle = (object_0[0] as string);
					this.mStrNextPage = (object_0[1] as string);
					this.panelTitle.strTitle = this.mStrTitle;
					return;
				}
			}
		}
		protected override void OnPageOut()
		{
			Log.smethod_5("LbsInputUserInfo", "OnPageOut");
		}
		protected override void OnPageBack()
		{
			Log.smethod_5("LbsInputUserInfo", "OnPageBack");
		}
		private void btnPreviousStep_Click(object sender, EventArgs e)
		{
			base.GoBack();
		}
		private void btnNextStep_Click(object sender, EventArgs e)
		{
			this.ctrlSetSexAreaSig.saveData();
			Account curAccount = AccountMgr.getCurAccount();
			if (curAccount != null)
			{
				if (2 != curAccount.nSex && 1 != curAccount.nSex)
				{
					MessageBoxManager.ShowToast(strings.Lbs_UserInfo_MsgNoSex, 2500, null, false);
					return;
				}
				if (string.IsNullOrEmpty(curAccount.strProvince) && string.IsNullOrEmpty(curAccount.strCity))
				{
					MessageBoxManager.ShowToast(strings.Lbs_UserInfo_MsgNoArea, 2500, null, false);
					return;
				}
			}
			base.GoToPage(this.mStrNextPage, new object[]
			{
				LbsPeopleListComeFrom.COME_FROM_GUIDE_PAGE
			}, true);
		}
		private void ctrlSetSexAreaSig_mInfoOkCallBack(object sender, bool bIsInfoOk)
		{
			if (base.get_ApplicationBar().get_Buttons().get_Item(0) == null)
			{
				return;
			}
			(base.get_ApplicationBar().get_Buttons().get_Item(0) as ApplicationBarIconButton).set_IsEnabled(bIsInfoOk);
		}
		[DebuggerNonUserCode]
		public void InitializeComponent()
		{
			if (this._contentLoaded)
			{
				return;
			}
			this._contentLoaded = true;
			Application.LoadComponent(this, new Uri("/MicroMsg;component/Source/Plugin/Lbs/UI/LbsInputUserInfo.xaml", 2));
			this.LayoutRoot = (Grid)base.FindName("LayoutRoot");
			this.panelTitle = (panelTitle2Line)base.FindName("panelTitle");
			this.ContentPanel = (StackPanel)base.FindName("ContentPanel");
			this.ctrlSetSexAreaSig = (SetAccInfoSexAreaSigCtrl)base.FindName("ctrlSetSexAreaSig");
		}
	}
}
